package io.lkt.modules.sys.dao;

import io.lkt.modules.sys.entity.BArticleInfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.lkt.modules.sys.entity.BUserShareArticleInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 文章信息表
 *
 * @author xss
 * @email dustwas@163.com
 * @date 2019-03-11 09:43:10
 */
@Mapper
public interface BArticleInfoDao extends BaseMapper<BArticleInfoEntity> {
    Integer queryTotal(Map<String, Object> map);

    List<BArticleInfoEntity> queryList(Map<String, Object> map);

    List<BArticleInfoEntity> informArticel(Map<String, Object> map);

    Integer informArticelTotal(Map<String, Object> map);

    Integer titleTotal(@Param("articleTitle") String articleTitle, @Param("brandId") String brandId);

    void setNullArticleBrandId(@Param("id") Integer id);

    void setNullArticleTypeId(@Param("id") Integer id);

    /**
     * 根据文章品牌查询文章信息 通过热度排序
     * @param articleBrandId
     * @param recordSize
     * @return
     */
    List<BArticleInfoEntity> queryArticleInfoByArticleBrandForHotScore(@Param("articleBrandId")Integer articleBrandId, @Param("recordSize")Integer recordSize);

    /**
     * 根据文章类型查询文章信息 通过热度排序
     * @param articleTypeId
     * @param recordSize
     * @return
     */
    List<BArticleInfoEntity> queryArticleInfoByArticleTypeForHotScore(@Param("articleTypeId")Integer articleTypeId, @Param("recordSize")Integer recordSize);

    void updateSourceHeight(@Param("id")Integer id, @Param("height")Integer height);

    List<BArticleInfoEntity> queryArticleInfoByArticleBrandTest(@Param("articleBrandId")Integer articleBrandId);

    List<BArticleInfoEntity> queryArticleInfoByTitle(@Param("articleTitle") String articleTitle);

    List<BArticleInfoEntity> queryArticleInfoByDesc(@Param("articleDesc") String articleDesc);

    List<BArticleInfoEntity> queryArticleInfoByTop();

    List<BArticleInfoEntity> queryArticleInfoByTop20200630();

    List<BArticleInfoEntity> queryArticleInfoByBrandId(@Param("articleBrandId")Integer articleBrandId);

    void delArticle(@Param("id") Integer id);

    List<BUserShareArticleInfoEntity> getUserCopyInfo(Map<String, Object> params);

    int getUserCopyInfoTotal(Map<String, Object> params);

    int getUserArticleCount(@Param("userId") Integer userId);

    List<BArticleInfoEntity> getVideoArticleDescByCreateTime();

    BArticleInfoEntity getLatestArticleByBranbId(Integer brandId);

    BArticleInfoEntity getBeginnerArticleById(Integer id);
}
